package com.tl.boot.entity.login.form;

import com.tl.boot.common.enums.ResultEnum;
import com.tl.boot.common.exception.BaseException;
import com.tl.boot.entity.demo.form.Base.BaseForm;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.StringUtils;

/**
 * com.tl.boot.entity.login.form -- ResetPWDForm
 * Description:
 * Created by joshua_liu <a href="mailto:joshualwork@163.com"></a>
 * On 2019/9/16 14:04
 */
public class ResetPWDForm extends BaseForm {
    @ApiModelProperty( value = "用户名", name = "username", example = "zhangsan@123！" )
    private String username;
    @ApiModelProperty( value = "密码", name = "pwd", example = "zhangsan@123！" )
    private String pwd;
    @ApiModelProperty( value = "确认密码", name = "confirmPwd", example = "zhangsan@123！" )
    private String confirmPwd;

    public String getConfirmPwd() {
        return confirmPwd;
    }

    public void setConfirmPwd(String confirmPwd) {
        this.confirmPwd = confirmPwd;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPwd() {
        return pwd;
    }

    public void setPwd(String pwd) {
        this.pwd = pwd;
    }

    @Override
    public void checkParam() {
        if (StringUtils.isBlank(this.username) || StringUtils.isBlank(this.pwd)) {
            throw new BaseException(ResultEnum.REQUEST_PARAM_ILLEGAL);
        }
    }
}
